@extends('self_service_end.layouts.default')

    color: #985407;
    font-family: inherit;
}
.carousel-ranking-list .table > tbody > tr > td {
    border: 0px;
}
</style>

<div id="carousel-top" class="carousel slide" data-ride="carousel" data-interval="15000">
    <!-- Indicators -->
    <ol class="carousel-indicators">
        {{ $index=1?'':'' }}
        @foreach($carousels as $carousel)
        <li data-target="#carousel-top" data-slide-to="{{ $index++ }}"></li>
        @endforeach
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox" >
        @foreach($carousels as $carousel)
        <div class="item">
            <img data-src="holder.js/1920x1080/auto/#555:#5555" src="{{ URL::to('file/image_crop/16/9/1920?name=').(($carousel->thumbs->count()>0) ? $carousel->thumbs->first()->path : 'default_food.jpg') }}" alt="...">
            @if(Carousel::$types[$carousel->type]['keyword'] == Carousel::ADVERTISEMENT)
            <div class="carousel-caption">
                {{ $carousel->description }}
            </div>
            @elseif(Carousel::$types[$carousel->type]['keyword'] == Carousel::FOOD_ORDER_RANKING_LIST)
            <div class="carousel-ranking-list">
                <table class="table" >
                    {{ $index=1?'':'' }}{{ $index++ }}
                    @foreach($doOrderFoodList as $orderFood)
                    <tr><td>{{ $index++ }}</td><td class="text-left">{{ strip_tags(String::tidy(Str::limit($orderFood->name,15))) }}</td><td class="text-right">{{ $orderFood->total_count }}</td></tr>
                    @endforeach
                </table>
            </div>
            @elseif(Carousel::$types[$carousel->type]['keyword'] == Carousel::USER_SETTLE_RANKING_LIST)
            <div class="carousel-ranking-list">
                <table class="table" >
                    {{ $index=1?'':'' }}{{ $index++ }}
                    @foreach($doSettleUserList as $account_log)
                    <tr><td>{{ $index++ }}</td><td class="text-left">{{ strip_tags(String::tidy(Str::limit($account_log->name,15))) }}</td><td class="text-right">{{ $account_log->total_price }}</td></tr>
                    @endforeach
                </table>
            </div>
            @endif
        </div>
        @endforeach
    </div>
</div>
@stop

@section('scripts')
<script type="text/javascript">
    $(function(){
        $('#carousel-top .carousel-indicators li:first').addClass('active');
        $('#carousel-top .carousel-inner .item').first().addClass('active');
    });

</script>
@stop